package com.umeox.watch.moto.dataservice.db.dao;

import android.database.Cursor;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.umeox.watch.moto.dataservice.db.model.TasksAttribute;

import java.util.List;

@Dao
public interface TasksAttributeDao {

    @Query("SELECT * FROM tasks_attribute")
    List<TasksAttribute> queryAll();

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(TasksAttribute tasksAttribute);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(List<TasksAttribute> tasksAttributes);

    @Delete
    int delete(TasksAttribute tasksAttribute);

    @Delete
    void delete(List<TasksAttribute> tasksAttributes);

    @Query("DELETE FROM tasks_attribute")
    int deleteAll();

    @Query("SELECT * FROM tasks_attribute")
    Cursor query();
}
